.class Lcom/netease/newsreader/util/CollectArticleAdapter$1;
.super Ljava/lang/Object;
.source "CollectArticleAdapter.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/netease/newsreader/util/CollectArticleAdapter;->getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

.field private final synthetic val$deleteID:Ljava/lang/String;


# direct methods
.method constructor <init>(Lcom/netease/newsreader/util/CollectArticleAdapter;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

    iput-object p2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->val$deleteID:Ljava/lang/String;

    .line 142
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 9
    .parameter "v"

    .prologue
    const/4 v8, 0x1

    const/4 v7, 0x0

    .line 147
    move-object v0, p1

    check-cast v0, Landroid/widget/CheckBox;

    .line 149
    .local v0, b:Landroid/widget/CheckBox;
    new-instance v1, Landroid/content/ContentValues;

    invoke-direct {v1}, Landroid/content/ContentValues;-><init>()V

    .line 150
    .local v1, initialValues:Landroid/content/ContentValues;
    invoke-virtual {v0}, Landroid/widget/CheckBox;->isChecked()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 151
    const-string v2, "ischecked"

    const-string v3, "1"

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 152
    iget-object v2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

    invoke-static {v2}, Lcom/netease/newsreader/util/CollectArticleAdapter;->access$0(Lcom/netease/newsreader/util/CollectArticleAdapter;)I

    move-result v3

    add-int/lit8 v3, v3, 0x1

    invoke-static {v2, v3}, Lcom/netease/newsreader/util/CollectArticleAdapter;->access$1(Lcom/netease/newsreader/util/CollectArticleAdapter;I)V

    .line 157
    :goto_0
    iget-object v2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

    invoke-static {v2}, Lcom/netease/newsreader/util/CollectArticleAdapter;->access$2(Lcom/netease/newsreader/util/CollectArticleAdapter;)Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2

    const-string v3, "collect_table"

    const-string v4, "auto_id=?"

    new-array v5, v8, [Ljava/lang/String;

    iget-object v6, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->val$deleteID:Ljava/lang/String;

    aput-object v6, v5, v7

    invoke-virtual {v2, v3, v1, v4, v5}, Landroid/database/sqlite/SQLiteDatabase;->update(Ljava/lang/String;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    .line 159
    iget-object v2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

    invoke-static {v2}, Lcom/netease/newsreader/util/CollectArticleAdapter;->access$0(Lcom/netease/newsreader/util/CollectArticleAdapter;)I

    move-result v2

    iget-object v3, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

    invoke-virtual {v3}, Lcom/netease/newsreader/util/CollectArticleAdapter;->getCount()I

    move-result v3

    if-ne v2, v3, :cond_1

    .line 160
    iget-object v2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

    invoke-static {v2}, Lcom/netease/newsreader/util/CollectArticleAdapter;->access$3(Lcom/netease/newsreader/util/CollectArticleAdapter;)Landroid/widget/CheckBox;

    move-result-object v2

    invoke-virtual {v2, v8}, Landroid/widget/CheckBox;->setChecked(Z)V

    .line 161
    iget-object v2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

    invoke-static {v2, v8}, Lcom/netease/newsreader/util/CollectArticleAdapter;->access$4(Lcom/netease/newsreader/util/CollectArticleAdapter;Z)V

    .line 167
    :goto_1
    return-void

    .line 154
    :cond_0
    const-string v2, "ischecked"

    const-string v3, "0"

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 155
    iget-object v2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

    invoke-static {v2}, Lcom/netease/newsreader/util/CollectArticleAdapter;->access$0(Lcom/netease/newsreader/util/CollectArticleAdapter;)I

    move-result v3

    add-int/lit8 v3, v3, -0x1

    invoke-static {v2, v3}, Lcom/netease/newsreader/util/CollectArticleAdapter;->access$1(Lcom/netease/newsreader/util/CollectArticleAdapter;I)V

    goto :goto_0

    .line 163
    :cond_1
    iget-object v2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

    invoke-static {v2}, Lcom/netease/newsreader/util/CollectArticleAdapter;->access$3(Lcom/netease/newsreader/util/CollectArticleAdapter;)Landroid/widget/CheckBox;

    move-result-object v2

    invoke-virtual {v2, v7}, Landroid/widget/CheckBox;->setChecked(Z)V

    .line 164
    iget-object v2, p0, Lcom/netease/newsreader/util/CollectArticleAdapter$1;->this$0:Lcom/netease/newsreader/util/CollectArticleAdapter;

    invoke-static {v2, v7}, Lcom/netease/newsreader/util/CollectArticleAdapter;->access$4(Lcom/netease/newsreader/util/CollectArticleAdapter;Z)V

    goto :goto_1
.end method
